import Mock from 'mockjs'
// import userAPI from './user'
// import tableAPI from './table'
// import subjectAPI from './subject'

// Fix an issue with setting withCredentials = true, cross-domain request lost cookies
// https://github.com/nuysoft/Mock/issues/300
Mock.XHR.prototype.proxy_send = Mock.XHR.prototype.send
Mock.XHR.prototype.send = function() {
  if (this.custom.xhr) {
    this.custom.xhr.withCredentials = this.withCredentials || false
  }
  this.proxy_send(...arguments)
}
// Mock.setup({
//   timeout: '350-600'
// })

// User
// Mock.mock(/\/user\/login/, 'post', userAPI.login)
// Mock.mock(/\/user\/info/, 'get', userAPI.getInfo)
// Mock.mock(/\/user\/logout/, 'post', userAPI.logout)

// Table
// Mock.mock(/\/table\/list/, 'get', tableAPI.list)
// information
// Mock.mock(/\/teamtopic\/list/, 'get', tableAPI.team)
// Mock.mock(/\/getTopic\/list/, 'get', tableAPI.topic)
// invitation
// Mock.mock(/\/inviteRecord\/list/, 'get', tableAPI.inviteRecord)
// Mock.mock(/\/user\/list/, 'get', userAPI.userList)
// Mock.mock(/\/rewardRecord\/list/, 'get', tableAPI.rewardRecord)
// promcode
// Mock.mock(/\/batch\/list/, 'get', tableAPI.batchList)
// Mock.mock(/\/courses\/list/, 'get', tableAPI.courseList)
// Mock.mock(/\/class\/list/, 'get', tableAPI.classList)
// Mock.mock(/\/member\/list/, 'get', tableAPI.memberList)

// Mock.mock(/\/course\/list/, 'get', subjectAPI.list)
// Mock.mock(/\/article\/list/, 'get', tableAPI.info)
// Mock.mock(/\/xitongrizhi\/list/, 'get', tableAPI.biaodanTable)
// Mock.mock(/\/xitongzijian\/list/, 'get', tableAPI.zijianTable)
export default Mock
